<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="modal.ProductModal" %>
<%@ page import="modal.UserModal" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="header.jsp" flush="true" />
<title>Bid-Market</title>
</head>
<body>

<% ProductModal prod = (ProductModal)session.getAttribute("prod"); %>
	<div class="col-md-offset-3 col-md-6 ">
		<div class="panel panel-default">
			<div class="panel-heading clearfix">
			
					

				<h2 class="panel-title pull-center"
					style="margin-top: 25px; font-size: 24px"> <% if(prod.getStatus()==1){
					out.println("--- SOLD ---  ");
					} %>
					<%=prod.getName() %>  <small><em> by <a
							href="/BidMarket/ProfileController/<%= prod.getOwnerId() %>"> <%= session.getAttribute("sellerEmail") %> </a></em></small>
				</h2>
			</div>
			<div class="panel-body">
				<div class=row>
					<div class="col-sm-6 col-centered">
						<img src="<%= prod.getPhotoUrl() %>" alt="productPhoto"
							class="img-thumbnail">
					</div>
					
					<div class="col-sm-6 col-centered">


						<h5 style="margin-top: 12px; text-align: left;">
							Original Desired Price:  <%= prod.getPrice() %><br>
						</h5>

						
						<h5 style="margin-top: 12px; text-align: left;">
							Description: <br> <%= prod.getDescription() %> <br>
						</h5>
						
						
					</div>
				</div>
				<%if (prod.getStatus()!=1 ) {%>
				<% if(!(session.getAttribute("user")!=null && prod.getOwnerId()==((UserModal)session.getAttribute("user")).getUserId())) {%>
				<jsp:include page="nonOwnerButtons.jsp" flush="true" />
				<%} else if(((UserModal)session.getAttribute("user"))!=null) {%>
				<jsp:include page="ownerButtons.jsp" flush="true" />
				<%} 
				}%>
			
				<% if (session.getAttribute("bids")!=null){%>
				<jsp:include page="bidsTable.jsp" flush="true" />	
				<%} if (session.getAttribute("sellerBids")!=null) {%>
				<jsp:include page="offersTable.jsp" flush="true"/>	
				<%} %>

			</div>
		</div>
	</div>

	<script type="text/javascript">
		
	</script>
</body>
</html>



